<html>
<!-- 
  Copyright 2010 Scott Logic Ltd.
  http://www.scottlogic.co.uk
  
  This file is part of Closure Charts.

  Closure Charts is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Closure Charts is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with Closure Charts.  If not, see <http://www.gnu.org/licenses/>.
-->
<head>
<title>JavaScript Charting Unit Tests - Rebased Line Series</title>
<script type="text/javascript" src="../../../../../../../../closure-library/src/main/webapp/js/goog/base.js"></script>
<script type="text/javascript" src="../unitTestDependencies.js"></script>
<script>
    goog.require('goog.testing.jsunit');
    goog.require('goog.dom');
    
    goog.require('scottlogic.chart.rendering.RebasedLineSeries');
</script>
</head>
<body>
<script>  
    // Clear the canvas after the charts have been tested
    function tearDown(){
        var canvas = goog.dom.$('canvas');
        canvas.innerHTML = '';
    }
    
    function testRebasing(){
        var series = new scottlogic.chart.rendering.RebasedLineSeries("id", [[1, 1],[2, 2],[3, 3],[4, 4]]);
        
        assertEquals("Correct rebase value", 1, series.rebaseValue_);
        assertEquals("Rebased correctly", 0, series.points[0][1]);
        assertEquals("Second point rebased correctly", 100, series.points[1][1]);
        assertEquals("Fourth point rebased correctly", 300, series.points[3][1]);
    }
   
</script>
<div id="canvas"></div>
</body>
</html>
